package com.lagou.server;

import com.lagou.model.TestPaper;
import com.lagou.model.TestScore;

import javax.xml.xpath.XPath;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface ServerTestPaperDao {

    /**
     * 增加考题
     * @param testPaper
     * @return
     */
    public boolean ServerInsertTestPaper(TestPaper testPaper);

    /**
     * 根据题目删除考题
     * @param topic
     * @return
     */
    public boolean ServerRemoveTestPaper(String topic);

    /**
     * 根据题目查询单个考题
     * @param topic
     * @return
     */
    public TestPaper ServerSelectTestPaperByTopic(String topic);

    /**
     * 查询所有考题
     * @return
     */
    public List<TestPaper>ServerSelectAllTestPaper();

    /**
     * 根据题目修改指定考题
     * @param topic
     * @param testPaper
     * @return
     */
    public boolean ServerUpdateTestPaper(String topic,TestPaper testPaper);

    /**
     * 根据路径导入考题
     * @param path
     * @return
     */
    public boolean ServerImportTestPager(String path) throws IOException, ClassNotFoundException;

    /**
     * 根据用户作答的考题结果 和 系统内部的考试结果 进行比较
     * @param
     * @return
     */
    public void ServerTestAnswerCheck(TestScore testScore);

    /**
     * 结果查询
     * @param testScore
     * @return
     */
    public TestScore ServerTestAnswerSelect(TestScore testScore);

    /**
     * 根据学号将学生成绩导出到指定目录
     * @param studentId
     * @param path
     * @return
     */
    public boolean ServerExportResultByStudentId(String studentId,String path) throws IOException;

    public void closeSavaData() throws IOException;
}
